package cn.trasen.his.poc.std.api.model.designer;

import cn.trasen.his.poc.std.api.emums.BedStatusEnum;
import cn.trasen.his.poc.std.api.emums.CardStatusEnum;
import cn.trasen.his.poc.std.api.emums.PatBedCardStatusEnum;
import cn.trasen.his.poc.std.api.emums.PersonClassEnum;
import pro.shushi.pamirs.meta.annotation.Field;
import pro.shushi.pamirs.meta.annotation.Model;
import pro.shushi.pamirs.meta.base.IdModel;
import pro.shushi.pamirs.meta.domain.model.ModelDefinition;
import pro.shushi.pamirs.meta.enmu.NullableBoolEnum;

@Model.model(DesignerModelView.MODEL_MODEL)
@Model(displayName = "床头卡模版设计")
@Model.Advanced(unique = "cardStatus, personClass, patBedCardStatus, bedStatus")
public class DesignerModelView extends IdModel {

    public static final String MODEL_MODEL = "ts.designer.DesignerModelView";

    @Field.many2one
    @Field(displayName = "模型", required = true)
    @Field.Relation(relationFields = {"model"}, referenceFields = {"model"},
            domain = "module =in= ('poc_demo') and systemSource =out= ('BASE', 'KERNEL', 'RELATION')  and show == 'ACTIVE' and type != 'ABSTRACT'")
    private ModelDefinition modelDef;

    @Field.String
    @Field(displayName = "模型编码", invisible = true)
    private String model;

    @Field.String
    @Field(displayName = "视图名称")
    private String viewName;

    @Field.Text
    @Field.Advanced(columnDefinition = "longtext")
    @Field(displayName = "页面模板json")
    private String templateJson;

    @Field.Enum
    @Field(displayName = "模式", required = true)
    private CardStatusEnum cardStatus;

    @Field.Enum
    @Field(displayName = "人员分类", required = true)
    private PersonClassEnum personClass;

    @Field.Enum
    @Field(displayName = "病人状态", required = true)
    private PatBedCardStatusEnum patBedCardStatus;

    @Field.Enum
    @Field(displayName = "床位状态-在院", required = true)
    private BedStatusEnum bedStatus;

    @Field.Enum
    @Field(displayName = "床位状态-非在院", required = true, store = NullableBoolEnum.FALSE, invisible = true)
    private BedStatusEnum otherBedStatus;

}
